<template>
    <div>
        <el-breadcrumb
            separator-class="el-icon-arrow-right"
            class="breadcrumb-base"
            style="line-height: 30px;"
        >
            <el-breadcrumb-item :to="{ path: '/my/shenKang-index' }">
                <i class="el-icon-s-home"></i>
                <span>上海申康</span>
            </el-breadcrumb-item>
            <el-breadcrumb-item>
                <span>正向校验</span>
            </el-breadcrumb-item>
        </el-breadcrumb>

        <div class="main-container">
            <div class="push-detail">
                <span style="color:#8F8F8F;">校验日期选择:</span>
                <el-date-picker
                    v-model="pushDetailDate"
                    value-format="yyyy-MM-dd"
                    type="date"
                    size="mini"
                    placeholder="选择日期"
                >
                </el-date-picker>
                <el-button
                    type="primary"
                    size="mini"
                    :loading="false"
                    style="margin-left:20px;"
                    @click='getDataList'
                >查询</el-button>
            </div>
            <el-table
                :data="tableData"
                border
                :cell-style="{'text-align':'center'}"
                :header-cell-style="{
          'background-color': '#E6E9EF',
          'color':'#777C7C',
          'font-weight':'400',
          'font-size' : '15px',
          'border-right': '1px solid #ffffff',
          'text-align':'center'}"
                size="mini"
                style="width: 50%;margin-top: 20px;"
            >
                <el-table-column
                    prop="businessId"
                    label="检查唯一编号"
                >
                </el-table-column>
                <el-table-column
                    prop="examImageCount"
                    label="切片数量"
                >
                </el-table-column>
                <el-table-column
                    prop="examImageRoiCount"
                    label="感兴趣区数量"
                >
                </el-table-column>
                <el-table-column
                    prop="msg"
                    label="结果"
                >
                </el-table-column>
                <el-table-column
                    prop="createTime"
                    label="创建时间"
                >
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script>
import { Message } from 'element-ui';
export default {
    name: 'positiveCheck',
    data() {
        return {
            pushDetailDate: '',
            tableData: [],
        };
    },
    mounted() {
        var now = new Date();
        var year = now.getFullYear(); //得到年份
        var month = now.getMonth() + 1; //得到月份
        var date = now.getDate() - 1; //得到日期
        this.pushDetailDate = year + '-' + month + '-' + date;
        this.getDataList();
    },
    methods: {
        //通过日期获取数据列表
        getDataList() {
            const that = this;
            this.$axios({
                method: 'GET',
                url: '/PROXY-Remote/skDataForwardCheck/list',
                params: {
                    createTime: that.pushDetailDate,
                },
            })
                .then(function (res) {
                    if (res.data.code !== 200) {
                        throw new Error(res.data);
                    } else {
                        console.log(res.data);
                        console.log(res.data.data);
                        that.tableData = res.data.data;
                    }
                })
                .catch(function (err) {});
        },
    },
};
</script>

<style scoped>
.pathological-data-Push {
    margin-top: 20px;
}
.push-detail {
    margin-top: 20px;
}
</style>
